Methods, apparatus, computer program and storage medium for position decoding

ABSTRACT

A method, in an apparatus for position decoding, operates to extract a sequence of positions from a sequence of images of a position-coding pattern, as recorded by a sensor. The method, which may be embodied as a computer program on a computer-readable storage medium, involves the steps of retrieving at least one reference position (P 1 , P 1′ ); and extracting the sequence of positions solely by matching information obtained from each of the images with a corresponding pattern reference area (MA), which represents a known subset of the position-coding pattern with a given, direct or indirect, spatial relation to the reference position(s).

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application claims the benefit of Swedish patent applicationNo. 0301248-1, filed on Apr. 29, 2003, and U.S. Provisional patentapplication No. 60/466,036, filed on Apr. 29, 2003, which both arehereby incorporated by reference.

FIELD OF THE INVENTION

The present invention generally relates to decoding of position-codingpatterns, and, more specifically, to methods for position decoding, inwhich a sequence of positions is extracted from a sequence of images ofa position-coding pattern, as recorded by a sensor.

The invention also relates to an apparatus, a computer program and astorage medium which can be used to decode a position-coding pattern.

BACKGROUND ART

Position-coding patterns are known which have the property that theabsolute position in the position-coding pattern for a partial area ofthe position-coding pattern of a smallest predetermined size can becalculated by means of the information in the partial area and apredetermined algorithm. Examples of such position-coding patterns aredisclosed in U.S. Pat. No. 5,477,012 (O. Sekendur), where each positionis coded by means of a symbol, and WO 92/17859 (Hewlett Packard Co.),U.S. Pat. No. 6,570,104 (Anoto AB), U.S. Pat. No. 6,674,427 (Anoto AB),U.S. Pat. No. 6,667,695 (Anoto AB), US 2003/0012455 (Anoto AB) and U.S.Pat. No. 5,973,110 (Xerox Corp), where each position is coded by meansof a plurality of symbols.

Position-coding patterns of this type can be used, for instance, fordigital recording of information which is written and/or drawn by handby means of a user unit on a base provided with the position-codingpattern. While moving the user unit, images of the position-codingpattern are continuously recorded locally at the tip of the user unit.One or more symbols in each of the images are decoded to a position. Thedecoded positions together constitute a digital description of the userunit's movement over the base.

The position-coding pattern in the recorded images can be decoded indifferent ways. For instance, aforesaid US 2003/0012455 discloses adecoding method which involves calculating probabilities that symbolswhich are identified in a recorded area of the position-coding patternassume any of a plurality of different possible decoding values. Theseprobabilities are stored as real (floating precision) numbers inprobability matrices and are used together with the different possibledecoding values for decoding the identified symbols into coordinates forpositions in the position-coding pattern.

Aforesaid U.S. Pat. No. 6,674,427 and U.S. Pat. No. 6,667,695 discloseother ways of decoding or determining a position from a recorded imageof a position-coding pattern.

The known position decoding methods may be regarded to have the commonfeatures that symbol data is extracted from an isolated image in asequence of images to be decoded; that position data is derived byeffecting one or more lookup operations, using the symbol data, in oneor more data structures that contain fundamental coding data of theposition-coding pattern; and/or that the symbol or position data is usedas input data to a mathematical formula for explicit calculation of anabsolute position.

Applicant's pending U.S. application Ser. No. 10/282,001, which was notyet publicly available at the date of filing of the present application,but later published as US 2003/0128194, discloses a method for positiondecoding, where a position for a recorded area of the position-codingpattern is calculated in a known manner, for instance in accordance withaforesaid US 2003/0012455. However, in case a decoding error is detectedfor said position, either for the position as a whole or for one of itscoordinates, an additional operation is performed as “a last resort”;information determined from the recorded area is compared or matchedwith information about how the position-coding pattern is composed in amatching area around a successfully decoded nearby position. The bestmatching portion of the known matching area is selected, and acorresponding position is determined as the decoded position. Thus, insummary, US 2003/0128194 discloses mandatory use of decoding bycalculation of position from recorded area, followed, in case of adecoding failure, by an additional matching operation.

SUMMARY OF THE INVENTION

An object of the invention is to provide an alternative to known methodsof position decoding from recorded images of a position-coding pattern.

More specifically, an object of the invention is to allow fast,efficient and yet robust decoding of a position-coding pattern.

Generally, the objects of the invention are at least partly achieved bymeans of methods, an apparatus, a computer program and a storage mediumaccording to the independent claims, preferred embodiments being definedby the dependent claims.

A first aspect of the invention is a method for position decoding, inwhich a sequence of positions is extracted from a sequence of images ofa position-coding pattern, as recorded by a sensor. The method comprisesthe steps of: retrieving at least one reference position; and extractingsaid sequence of positions solely by matching information obtained fromeach of said images with a corresponding pattern reference area, whichrepresents a known subset of the position-coding pattern with a givenspatial relation to said reference position.

That said sequence of positions is extracted solely by matchinginformation from each of said images with said corresponding patternreference area means that the method is not based on any preceding stepin which an attempt is made to calculate the positions in another waythan through aforesaid extracting by matching.

Each position in said sequence of positions may be extracted by:determining a relative location, within said pattern reference area, ofa match between said information and said pattern reference area; andadjusting said spatial relation by said relative location to therebyderive said position. Thus, the sequence of positions may be extractedin a fast and efficient way.

The pattern reference area, which represents the known subset of theposition-coding pattern, may be generated for each image to be decoded.Alternatively, the pattern reference area may be generated onlyintermittently, to thus be used in the decoding of several consecutiveimages in the sequence of images.

The given spatial relation of the pattern reference area to said atleast one reference position may be either direct, in that the spatiallocation of each pattern reference area is directly defined orcalculated from the reference position(s), or indirect, in that thespatial location is defined or calculated from one or more precedingpositions, which are preceding in the sense that they have beenextracted by preceding steps of matching. Each such preceding positionagain has a defined spatial location, directly or indirectly, withrespect to the reference position(s).

The spatial relation may be given by a predicted position which isestimated based on said at least one reference position, and by saidpattern reference area being generated with a given positionalrelationship to said predicted position. Preferably, the predictedposition is included in the known subset of the position-coding patternas represented by the pattern reference area. Thereby, the matching maybe effected around the predicted position.

The step of estimating the predicted position may be effected for eachimage, to generate a sequence of predicted positions, which in turn maybe converted, by said step of extracting by matching, to said sequenceof positions. The conversion may be effected for a group of predictedpositions, or sequentially by each predicted position being converted bymatching to a decoded position before estimating a subsequent predictedposition.

Each predicted position may be estimated based on at least two precedingpositions selected from said at least one reference position and/or saidsequence of positions. Moreover, each predicted position may beestimated by polynomial, such as linear, extrapolation of said at leasttwo preceding positions.

The reference position may be retrieved by calculating a position basedon an image of said position-coding pattern in accordance with a priorart method of position decoding or calculation. Such a calculation maytypically include: extracting symbol data from an isolated imagepreceding said sequence of images; deriving position data by effectingone or more lookup operations, using said symbol data, in one or moredata structures that contain fundamental coding data of theposition-coding pattern; and/or inputting said symbol or position datato a mathematical formula for explicit calculation of an absoluteposition.

The step of retrieving may be effected intermittently to update orreplace said at least one reference position, the thus-retrievedreference position(s) being used in a subsequent step of extracting bymatching for a subsequent sequence of images. The retrieval may beeffected at a fixed sampling interval, or whenever a need for, oropportunity of, such retrieval is detected. In digitizing the movementof a writing implement on a position-coded base, a single handwritingstroke may be represented by several consecutive sequences of positions,each being extracted by matching. The method may suitably comprise thestep of merging said at least one reference position with saidsequence(s) of positions, so as to form a true representation of themovement.

In one embodiment, the corresponding pattern reference area for anindividual image among said sequence of images includes a plurality ofpartial areas defining a plurality of respective candidates to aposition represented by the position-coding pattern in said individualimage. In this embodiment, the step of extracting by matching mayinclude comparing the information obtained from said individual imagewith each of said plurality of partial areas included in thecorresponding pattern reference area. The step of extracting may furtherinclude selecting the candidate for which the comparing step indicatescorrespondence between the information obtained from said individualimage and any of said plurality of partial areas.

The method described above for position decoding can advantageously beused together with any of the position-coding patterns that have beendeveloped by Anoto AB and are described in for instance U.S. Pat. No.6,674,427 or U.S. Pat. No. 6,667,695. Thus, the position-coding patternmay comprise a plurality of marks, wherein each mark codes one of atleast two different values in at least one dimension.

In one embodiment, which is adapted for use with a position-codingpattern of the above type, the step of extracting by matching includesobtaining said information from an individual image among said sequenceof images by generating a probability matrix, said probability matrixrepresenting a subarea of the position-coding pattern which is includedin said individual image and containing one matrix element for each markin said subarea, wherein each matrix element is adapted to store eithera value which represents a most probable estimated value of its mark, ora value which represents that no value has been estimated for its mark.The value which represents a most probable estimated value is preferablyan integer value. Using integer, e.g. binary, values in the probabilitymatrix allows fast and efficient matching with the pattern referencearea, since matrix operations performed on integers are faster toperform than for, e.g., real numbers.

For a position-coding pattern of the above type, where each mark codes abinary value in a first dimension and a binary value in a seconddimension, a first probability matrix may be generated for the values ofthe marks in said first dimension and a second probability matrix may begenerated for the values of the marks in said second dimension.

In one embodiment, said step of extracting by matching includescomparing the or each probability matrix with each of said plurality ofpartial areas included in the corresponding pattern reference area. Thismay be done by bit-wise correlation between the one-dimensional contentsof the probability matrix and the contents, in the same dimension, ofeach equally sized partial area.

Another embodiment is particularly adapted for use with aposition-coding pattern, each dimension of which is based on shifts of acyclic main number sequence, wherein any subsequence, of a firstpredetermined length or longer, of said cyclic main number sequence hasan unambiguously determined position in said cyclic main numbersequence, and based on a sequence of difference numbers representingdifferences in shifts between pairs of said main number sequence in theposition-coding pattern, wherein any subsequence, of a secondpredetermined length or longer, of said difference number sequence hasan unambiguously determined position in said difference number sequence.This pattern may be of the type referred to above. In this embodiment,the step of extracting by matching includes: obtaining a first set ofdifference numbers for said pattern reference area; obtaining a secondset of difference numbers from the or each probability matrix; matchingsaid second set of difference numbers with said first set of differencenumbers; and extracting a position of said position-coding pattern, insaid dimension, from a match from said matching step.

The second set of difference numbers may be obtained by matchingrespective rows or columns of the or each probability matrix with saidmain number sequence so as to estimate main number sequence positionsfor said rows or columns, and deriving the difference numbers of saidsecond set of difference numbers by subtracting estimated main numbersequence positions for pairs of rows or columns of the or eachprobability matrix.

A second aspect of the invention is a method for position decoding bydetermining a position on the basis of information obtained from apartial area, recorded by a sensor, of a position-coding pattern, theposition-coding pattern comprising a plurality of marks, each markcoding one of at least two different values in at least one dimension.This method includes the steps of: generating a probability matrix, saidprobability matrix containing one matrix element for each mark in saidpartial area, each matrix element being adapted to store either a valuewhich represents a most probable estimated value of its mark, or a valuewhich represents that no value has been estimated for its mark; matchingsaid probability matrix with information about how the position-codingpattern is composed in a pattern reference area of said position-codingpattern, said pattern reference area being larger than said partial areaand including said partial area; and selecting, as the position to bedetermined, the one of the positions defined by said pattern referencearea for which the matching step indicates correspondence between saidprobability matrix and said matching area.

The methods described above can be accomplished in hardware or software.Thus, a third aspect of the invention is a computer program, whichcomprises program code that, when executed in a computer, causes thecomputer to carry out a method according to the first or second aspect.

The computer program can be executed by a processor which is arranged inthe same unit as the sensor that images the partial area, for which aposition is to be decoded, or in another unit.

The computer program can be stored and distributed in the form of astorage medium, such as an electronic memory like RAM, SRAM, DRAM,SDRAM, ROM, PROM, EPROM, EEPROM, etc; an optical disk; a magnetic diskor tape; or some other commercially available storage medium. Thestorage medium can also be a propagating signal.

According to a fourth aspect, the invention concerns an apparatus whichcomprises a signal-processing unit, which is adapted to perform a methodaccording to the first or second aspect.

The signal-processing unit may e.g. be realized by a suitably programmedprocessor, by specifically adapted hardware, such as an ASIC(Application-Specific Integrated Circuit) or an FPGA (Field ProgrammableGate Array), by digital or analog circuits or any combination thereof.

Other objects, features and advantages of the invention are apparentfrom the following detailed description of the invention, from theappended claims and from the drawings.

Of course, features of the different embodiments of the invention may becombined in one and the same embodiment.

Generally, all terms used in the claims are to be interpreted accordingto their ordinary meaning in the technical field, unless explicitlydefined otherwise herein. All references to “a/an/the [element, device,component, means, step, etc]” are to be interpreted openly as referringto at least one instance of said element, device, component, means,step, etc., unless explicitly stated otherwise. The steps of any methoddisclosed herein do not have to be performed in the exact orderdisclosed, unless explicitly stated otherwise.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention will now be described in more detail with reference to theaccompanying drawings.

FIG. 1 is a schematic view of a system in which the invention can beused.

FIG. 2 is a schematic illustration of decoding and matching of partialareas of a position-coding pattern.

FIG. 3 is a flow chart that illustrates a general method according tothe invention of determining a position by decoding an image of apartial area of a position-coding pattern.

FIG. 4 is a schematic illustration of a position-coding pattern whichmay be decoded according to the present invention.

FIG. 5 shows four ideal locations of a mark in a position-codingpattern.

FIG. 6 is a schematic illustration of an apparatus, in the form of anelectronic pen, in which the position decoding according to theinvention may be carried out.

FIG. 7 is a schematic block diagram of an electronic circuitry part andan image sensor in the device shown in FIG. 6.

FIG. 8 is a schematic illustration that demonstrates the way in which abinary offset probability matrix is generated.

FIG. 9 is a flowchart diagram of a first embodiment of a decoding methodaccording to the invention.

FIG. 10 shows a generated local position-coding pattern and a binaryoffset probability matrix to illustrate the operating principle of thefirst embodiment.

FIGS. 11, 12 and 13 are schematic illustrations to support thedescription of a second embodiment.

FIG. 14 illustrates an alternative embodiment, where use is made of boththe first and the second embodiment.

DETAILED DESCRIPTION OF THE INVENTION

FIG. 1 shows a system for information management, in which the presentinvention can be used. The system comprises a base 1 in the form of asheet of paper, a user unit 2 and an external unit 3. The sheet of paperis provided with a position-coding pattern, only a small part 4 of whichis schematically indicated in an enlarged scale. The user unit 2 can beused to write on the sheet of paper 1 in the same way as with anordinary pen and to simultaneously record what is being written indigital form. The digitally recorded information can be processed in theuser unit 2 and/or the external unit 3, to which it can be sentautomatically (on-line) or when commanded by the user. For the digitallyrecorded information to correctly reflect the information on the sheetof paper, it is important that the position decoding be made ascorrectly and completely as possible.

The position-coding pattern, which will be described in more detailbelow, is made up of graphical symbols, which are arranged or designedaccording to predetermined rules. This means that if a partial area ofthe position-coding pattern is correctly imaged, said partial areahaving a predetermined minimum size, the position of the partial area inthe position-coding pattern can be determined unambiguously by means ofone or more symbols in the imaged partial area and a predetermineddecoding algorithm. The position can be obtained as a pair ofcoordinates in a Cartesian or another coordinate system.

When a user writes by means of the user unit 2 on the sheet of paper 1,the user unit will continuously record images of a partial area of theposition-coding pattern at the tip of the user unit. Each image isdecoded to a position. A sequence of such decoded positions thenconstitutes a digital representation of the movement of the user unit 2over the sheet of paper and, thus, of what is written on the sheet ofpaper.

The decoding of the position-coding pattern can take place in the userunit 2, in the external unit 3 or in some other unit to which the imagesof the position-coding pattern are sent in a more or less processedform.

As mentioned above, the information in the partial area is decoded bymeans of a predetermined decoding algorithm. This functions well as longas the partial area is correctly imaged. Under actual conditions,however, the user unit often cannot image the partial area entirelycorrectly, for instance because of poor lighting conditions, or whenuser holds the pen in an inclined position which causes the partial areato be imaged in perspective, or if the recorded image is deformed by theimaging mechanism or by other disturbances such as signal noise. It mayhappen that the decoding algorithm misinterprets a symbol or misses asymbol, thereby making it harder to decode the position correctly.Errors can also arise if the position-coding pattern is not quiteaccurately reproduced on the sheet of paper but has been deformed tosome extent when being applied to the sheet of paper. Under certainconditions, errors can be discovered, for example, if theposition-coding pattern contains redundant information which enableserror detection or if the decoded position is unreasonable in relationto previously or subsequently decoded positions.

FIGS. 2 and 3 illustrate a general method according to the invention ofdetermining a position by decoding an image of a partial area of aposition-coding pattern. This method allows for fast, efficient andreliable decoding even if it has not been possible to successfullyrecord and interpret all symbols within the partial area of theposition-coding pattern. A sheet of paper 1 is provided with aposition-coding pattern P, which for the sake of clarity is not shown inFIG. 2. A small portion of the position-coding pattern P is howevershown at 20 in FIG. 4. As will be explained in more detail in thefollowing, the position-coding pattern comprises a plurality of marks 22which partly constitute the code symbols of the pattern.

As seen in FIG. 2, two partial areas PA1 and PA1′ of the position-codingpattern P code positions P1 and P1′, respectively. It is assumed in FIG.2 that positions P1 and P1′ have been successfully decoded from recordedimages of partial areas PA1 and PA1′ by way of any applicable decodingmethod. Next, in step 310 of FIG. 3 an image of a new partial area PA2(not explicitly shown in FIG. 2) is recorded, for which it is desired todecode a corresponding position P2. The recorded image is preprocessedin a step 320 so as to form a suitable input for a following step 330,in which marks 22 are identified and a virtual raster 21 is fit to themarks. Steps 320 and 330 may be performed by way of techniques that arewell known in the art, such as filtering, binarization or thresholding,and utilization of the distance between different pairs of dots orutilization of Fourier transforms, as is described for instance in U.S.Pat. No. 6,548,768 and US 2002/0044138.

Following steps 320 and 330, the actual decoding occurs in steps 340 and350. First, a pair of matrices, referred to as x-BOPM and y-BOPM in thefollowing, are generated by estimating the values represented by themarks 22 of the partial area PA2 in x and y dimensions. The informationkept by these matrices will then be used for matching with informationabout how the position-coding pattern P is composed in a matching areaMA. The information in the matching area MA may be generated exclusivelyfor the decoding of only one position by matching. As seen in FIG. 2 andas will be described in more detail later, the matching area MA islarger than the partial area PA2 and has a given positional relation toa prediction PA2 _(predicted) of the partial area PA2. The predictionPA2 _(predicted) corresponds to a predicted position P2 _(predicted)which is determined from the positions P1 and P1′ of the previouslydecoded partial areas PA1 and PA1′. Positions P1 and P1′ are thusexamples of the “at least one reference position” referred to in theSummary section of this document, and the matching area MA is an exampleof the “pattern reference area”.

The size of the matching area MA may be set to a constant value whichreflects a normal or default handwriting speed. For instance, thematching area MA may contain 32×32 code symbols. Alternatively, the sizeof the matching area MA may be adjusted dynamically depending onappropriate input data, such as current handwriting speed. The size ofthe partial area PA2 may be chosen in view of the size of the matchingarea MA and also depending on the size of the recorded images. Thepartial area PA2 need not occupy the entire part of an recorded image.The partial area need not even have the above-discussed minimum size forunambiguous position determination. Generally speaking, the robustnessof the decoding process increases with increasing size of the partialarea, whereas the speed and the efficiency of the decoding processincrease with decreasing size of the partial area. At present, a size of16×16 code symbols is used for the partial area PA2.

The result of steps 340 and 350 may be the partial area PA2 _(matched)that best matches an equally sized subarea of the matching area MA, andthe relative location of PA2 _(matched) with respect to the matchingarea MA and, thus, with respect to the predicted position P2_(predicted). Hence, a position P2 _(matched) defined by the resultingpartial area PA2 _(matched) may be determined by simply adding thisrelative location to the predicted position P2 _(predicted). As seen inFIG. 2, while in practice the predicted partial area PA2 _(predicted)will not exactly correspond to the recorded partial area PA2, thematched partial area PA2 _(matched) will. Thus, the result of thedecoding method will be the position P2 _(matched) which is identical tothe position P2 sought for. The determined position may be verified in astep 360.

A brief description of an apparatus—in the form of an electronic pen—inwhich the position decoding according to the invention may be carriedout will now be given with reference to FIGS. 6 and 7.

The apparatus of FIGS. 6 and 7 can constitute the user unit 2 in FIG. 1.It comprises a casing 2011 having approximately the same shape as a pen.In one short side of the casing there is an opening 2012. The short sideis intended to abut against or be placed a short distance from thesurface on which the position determination is to take place.

The casing essentially contains an optics part, an electronic circuitrypart, and a power supply.

The optics part comprises a light-emitting diode 2013 for illuminatingthe surface which is to be imaged and a light-sensitive area sensor2014, such as a CCD (Charge Coupled Device) or CMOS (ComplementaryMetal-Oxide Semiconductor) sensor, for recording a two-dimensionalimage. The apparatus may also comprise an optical system, such as amirror and/or lens system. The light-emitting diode can be an infraredlight-emitting diode and the sensor can be sensitive to infrared light.

Generally speaking, the image sensor 2014 may be replaced by any kind ofsensor that is suitable for imaging the position-coding pattern so thatan image of the marks is obtained in black and white, in grey scale orin color. Such a sensor can be a solid-state single- or multi-chipdevice which is sensitive to electromagnetic radiation in any suitablewavelength range. For example, the sensor may include a CCD element, aCMOS element, or a CID element (Charge Injection Device). Alternatively,the sensor may include a magnetic sensor array for detection of amagnetic property of the marks. Still further, the sensor may bedesigned to form an image of any chemical, acoustic, capacitive orinductive property of the marks.

The power supply to the apparatus is obtained from a battery 2015 whichis mounted in a separate compartment in the casing. The power supply canalso be obtained via a cable from an external power source (not shown).

The electronic circuitry part 2016 comprises a processor unit with aprocessor which may be programmed to read images from the sensor andcarry out position calculation, matching and verification on the basisof these images, as well as a working memory and a program memory.

Furthermore, in the shown embodiment, the apparatus comprises a penpoint 2017, by way of which it is possible to write ordinarypigment-based ink on the surface upon which the position determinationis to be carried out. The pen point 2017 can be extendable andretractable, so that the user can control whether or not it is to beused. In certain applications, the apparatus need not have a pen pointat all.

Suitably, the pigment-based ink is of a type that is transparent toinfrared light, while the marks absorb infrared light. By using alight-emitting diode which emits infrared light and a sensor which issensitive to infrared light, the detection of the pattern takes placewithout any interference between the above-mentioned writing and theposition-coding pattern.

Moreover, the apparatus may comprise buttons 2018 by means of which theuser will activate and control the apparatus. It also comprises atransceiver 2019 for wired or wireless transmission, e.g. using cable,IR light, radio waves or ultrasound, of information to and from theapparatus. The apparatus can also comprise a display 2020 for showingpositions, recorded information or other information to the user.

The apparatus can be divided into different physical casings. The sensorand other components that are necessary for capturing images of theposition-coding pattern and for transmitting them may be located in afirst casing, while the signal-processing unit and the other componentsthat are necessary for carrying out the position decoding may be locatedin a second casing.

FIG. 7 is a schematic block diagram of the electronic circuitry part2016 and the image sensor 2014 in the apparatus shown in FIG. 6. An ASIC700 implements the electronic circuitry part 2016 and contains a CPU 720as a main controller of the electronic circuitry. The CPU 720 has accessto a memory 730 through an on-chip data bus 760. The image sensor 2014is implemented as a CMOS area sensor 750, which is connected to the databus 760 of ASIC 700 and which is capable of producing 96×96-pixel,256-level grayscale digital images at a frequency of about 100 Hz. Animage preprocessor 710 on ASIC 700 will operate on images received fromthe image sensor 750 in accordance with step 320 of FIG. 3 and store thepreprocessed images in memory 730. The CPU 720 will generate the x-BOPMand y-BOPM matrices and will also perform the decoding of partial areasinto positions. A matching unit 740 may assist the CPU 720 in thesetasks. In an alternative embodiment, the ASIC 700 may be designed tooperate without intermediate storage of the preprocessed images.

In the following, the position decoding will be exemplified anddescribed in more detail with reference to a specific position-codingpattern which has been developed by the applicant and which isthoroughly described in, inter alia, U.S. Pat. No. 6,667,695.Position-coding patterns of similar types are described in detail in WO01/16691, U.S. Pat. No. 6,663,008 and U.S. Pat. No. 6,674,427. Analternative position-coding pattern is shown in U.S. Pat. No. 6,570,104.

The position coding is based on a number sequence which below isreferred to as difference number sequence. This difference numbersequence has the property that if one takes an arbitrary partialsequence of a predetermined length, for instance a partial sequence withfive difference numbers, this partial sequence always has anunambiguously determined location in the difference number sequence. Inother words, it appears only once in the difference number sequence andcan thus be used for position determination. More specifically, thedifference number sequence “runs” along the x axis as well as along they axis of the position-coding pattern.

The actual position-coding pattern is made up of simple graphicalsymbols 22 which can assume four different values, 0-3. As seen in FIGS.4 and 5, each symbol 22 contains a mark which, for instance, can havethe shape of a dot and which can be displaced a distance 24 in one offour different directions relative to a nominal position 23 or rasterpoint. The nominal position 23 is at an intersection between rasterlines 21 in a grid that may be virtual, i.e. invisible to the areasensor in the pen, or actual, by the raster lines being wholly or partlyvisible to the area sensor. The value of the symbol is determined by thedirection of the displacement. Each symbol value 0-3 can be convertedinto one bit which is used for coding an x coordinate and one bit whichis used for coding a y coordinate, i.e. into the pairs of bits (0,0),(0,1), (1,0), and (1,1). Thus, the coding is made separately in the xdirection and the y direction, but the graphical coding is made with asymbol which is common to the x and y bits.

The distance 24 is suitably not less than about ⅛ and not more thanabout ¼, preferably about ⅙, of the distance between two adjacent rasterlines 21. The distance can, for example, be about 300 micrometers orabout 254 micrometers. The latter distance is particularly suitable forprinters and scanners, which often have a resolution that is a multipleof 100 dpi (dots per inch).

Each position is coded by 6*6 symbols which can thus be converted into a6*6 bit matrix for an x coordinate and a 6*6 bit matrix for a ycoordinate for the position. If the x bit matrix is considered, this canbe divided into six columns of six bits each. Each sequence of bits in acolumn constitutes a partial sequence in a 63-bit-long cyclic mainnumber sequence which has the property that if a partial sequence havinga length of six bits is selected, this has an unambiguously determinedplace in the main number sequence. The six columns can thus be convertedinto six position numbers or sequence values which correspond to sixplaces in the main number sequence. Between these six position numbers,five difference numbers can be formed in pairs, which constitute apartial sequence of the difference number sequence and which thus havean unambiguously determined place in the same and, consequently, anunambiguously determined place along the x axis. For a certain xcoordinate, the position numbers will vary depending on the ycoordinate. On the other hand, the difference numbers will be the sameindependently of the y coordinate, since the position numbers alwaysvary according to the main number sequence, which is repeated cyclicallyin the columns in the entire position-coding pattern.

Correspondingly, six rows in the y bit matrix define six positionnumbers in the main number sequence. These six position numbers definefive difference numbers, which constitute a partial sequence of thedifference number sequence and which thus have an unambiguouslydetermined place along the y axis.

When the position-coding pattern is used, images of different parts ofthe position-coding pattern are recorded, as has been described above.As a rule, the images contain considerably more than 6*6 symbols. Thus,the decoding may be based on the best n*m symbols in the image, with nand m being any number of symbols equal to 6 or larger. For example, thedecoding may be based on the best 8*8 or 16*16 symbols. The extrasymbols are used, inter alia, for error detection and/or correction.

In the following, position decoding based on the above-describedposition-coding pattern will be described with reference to thedrawings. The position decoding is preferably carried out by means of aprocessor and suitable program code which can be available in the userunit 2 or the external unit 3 in FIG. 1 or in some other unit.

Since the position-coding pattern is not always perfectly reproduced ona surface and since the user unit sometimes deforms the position-codingpattern during imaging, it may be difficult to determine quite safelythe displacements of the dots and, thus, the value of the symbols.Instead, for each symbol the probability that the symbol assumes any ofthe four different possible values may be determined. According toembodiments of the present invention, aforesaid two matrices aregenerated in step 340 of FIG. 3 for an imaged partial area PA—one forcolumns (x coordinate encoding) and one for rows (y coordinateencoding). Each matrix element in each of these two matrices may containan integer value that represents the estimated binary value of thesymbol in the x direction and y direction, respectively. This is incontrast to the prior art, e.g. aforesaid US 2003/0012455, where eachmatrix element contained two real numbers (floating-precision numbers)representing the probability of the symbol value “0” and “1”,respectively. These two matrices may be referred to as Binary OffsetProbability Matrices (BOPM) and are identified as “x-BOPM” and “y-BOPM”in the drawings.

In addition, each matrix element in the x-BOPM and y-BOPM matrices mayindicate that no binary value was estimated for the symbol, e.g. becauseit was not possible, at some level of certainty, to decide which of thefour possible displaced positions (FIG. 5) that the mark 22 in questionassumes.

Thus, each matrix element in the x-BOPM and y-BOPM matrices will containany of the values “0”, “1” or “-”, the latter representing that nobinary value was estimated for the symbol.

Various methods may be employed when analyzing a recorded andpreprocessed image so as to estimate, if possible, the binary values ofthe symbol in the x and y directions—as given by the displacement of themark 22—and otherwise represent the symbol by the uncertainty value “-”.

For instance, for each identified mark it may be investigated whether itlies within a certain “safe” zone around any of the four idealdisplacement positions shown in FIG. 5. Such “safe” zones may e.g. bedefined by circular areas having their centers at respective ones of thefour ideal displacement positions and having a predefined radius. Thus,if a mark is found to lie within any such “safe” zone, the symbol isheld to have the value represented by the ideal displacement positionthat forms the center of the “safe” zone.

Alternatively, “full-scale”, real-number probability matrices may becalculated based on a distance function that outputs a real-numberprobability value based on the displacement of a mark from an idealdisplacement position. Examples of such calculations are given inaforesaid US 2003/0012455. Then, probability threshold values may beapplied to the real-number probability matrices, such that if forinstance such a probability matrix indicates that a certain mark encodesa “0” or a “1” at a probability in excess of 0.8, where 0.8 is thethreshold, then the corresponding matrix element in the x-BOPM or y-BOPMmatrix will be set to “0” or “1”; otherwise the matrix element will beset to “-”.

As still an alternative, if the encoding of the marks is such that thesame x value (y value) is used for the two ideal positions that lieabove a diagonal line through the raster point 23 (e.g. positions b andc in FIG. 5) as well as for the other two that lie below such a diagonalline (e.g. positions a and d in FIG. 5), the location of an identifiedmark and its distance to such a diagonal line may be used to estimatethe binary values of the symbol in question.

The x-BOPM and y-BOPM matrices thus produced are used in step 350 ofFIG. 3 in two different ways, according to the disclosed embodiments, soas to decode the position coded by the pattern in the partial area PA ofthe recorded image.

In a first embodiment, which will be described with reference to FIGS.8-10, a method referred to as Pattern Neighborhood Matching (PNM) isused for matching a recorded partial area PA (as represented by thex-BOPM and y-BOPM matrices) with a larger matching area MA of theposition-coding pattern, generated around a predicted position in theposition-coding pattern. The predicted position is produced frompreceding positions defined by preceding partial areas of theposition-coding pattern. Here, a complete bit-wise correlation betweenthe recorded partial area PA and the generated matching area MA isperformed. Thus, this method will be capable of successful decoding alsoif the recorded partial area PA contains several uncertain orincorrectly estimated symbols.

A second embodiment, which will be described with reference to FIG.11-13, concerns a method referred to as Pattern Sequence Matching (PSM).Here, no full bitwise correlation between recorded partial area PA andmatching area MA is performed. Instead, matching is made betweendifference subsequences found in the recorded partial area PA anddifference subsequences for a larger matching area MA, which again isgenerated around a predicted position in the position-coding pattern.This method will be faster, since the number of matches performed issmaller than for the PNM method (ideally, the running time will beproportional to the sum of the side lengths of the matching area ascompared to the product of the side lengths). It is, however, lesscapable of decoding partial areas with many uncertain or incorrectlyestimated symbols.

Pattern Neighborhood Matching

As explained above, the position-coding pattern is a composition of an xencoding and a y encoding. Thus, the decoding may be handled separatelyfor the two dimensions. FIG. 8 schematically shows a recorded partialarea 800, consisting of 10×10 raster intersections and dots positionedat different displacements from the respective intersections. For eachcolumn (and each row) some of the encoded x (and y, respectively) valuesmay be determined by identifying that a dot is located sufficientlyclose to one of the four possible ideal displacements—“right”,“upwards”, “left” or “downwards” by e.g. ⅙ of the raster cell size. Forinstance, dot 840 may be determined to represent displacement “left”,thereby yielding (x, y)=(1, 0) according to coding legend 830. On theother hand, at some raster intersections it will not be possible todecide what a nearby dot, if any, encodes. For instance, dot 850 islocated too close to its raster intersection, and at intersection 860,no dot is present at all. In these cases, neither x nor y value can beestimated. Thus, there is a need to express uncertainty about the valueat a certain raster intersection, in x and/or y dimension.

By traversing the columns and rows of the recorded partial area in theabove-described manner and in accordance with step 340 in FIG. 3, threecharacters or values “0”, “1” and “-” may be used to represent theinterpretation of column encodings (e.g. 820 in FIG. 8) and rowencodings (e.g. 810 in FIG. 8), wherein the “-” indicates uncertaintyabout the dot displacement.

As already mentioned, this process results in two matrices, one forcolumns (x-coordinate encoding) and one for rows (y-coordinateencoding), namely the binary offset probability matrices x-BOPM andy-BOPM. An y-BOPM example is given at 1010 in FIG. 10. In a sense, thex-BOPM and y-BOPM are trinary rather than binary, since in addition tobinary values they also have one value that represents uncertainty.

The x-BOPM and y-BOPM may be stored in memory 730. In more detail, eachrow of a matrix may be stored in a first n-bit data register (n beingthe size of the matrix in one dimension) that represents the “certain”values “0” and “1”, and in a second n-bit data register that representsbit flags as to whether or not uncertainty applies to the correspondingvalue in the first n-bit data register. If a bit flag is set in thesecond data register, this will mean that the corresponding bit value isnot to be used and that the matrix cell in question has a “-” value.

FIG. 9 illustrates the pattern neighborhood matching method 900, whichimplements the decoding and verifying steps 350 and 360 for thisembodiment. Input data for this method is the above-mentioned two binaryoffset probability matrices x-BOPM and y-BOPM, as generated in step 340of FIG. 3, as well as the two preceding positions P1 and P1′ of FIG. 2.

In step 910, based on the two preceding positions P1 and P1′, a nextposition P2 _(predicted) is derived by linear extrapolation frompositions P1 and P1′. As an alternative, more than two precedingpositions may be used for predicting the next position, wherein anyknown motion prediction model may be used, such as polynomialextrapolation. As yet an alternative, only one preceding position may beused, if the prediction is combined with motional data input concerninge.g. direction of movement, speed or acceleration of the user unit 2, orother useful information, such as default or predefined information onexpected handwriting speed. Only one preceding position may also be usedif the size of the matching area MA is set adequately large to include afollowing position. Such a matching area is suitably centered around thepreceding position. The above alternatives may also be combined, e.g. bydifferent numbers of preceding positions being used at different stagesof the decoding process.

The or each preceding position P1, P1′ may be determined in differentways. For instance, at the very beginning of a pen stroke, P1, P1′ maybe calculated in accordance with any prior art method, including but notlimited to the ones described in aforesaid U.S. Pat. No. 6,667,695, US2003/0012455 and U.S. Pat. No. 6,674,427, all incorporated herewith byreference. Then, as new positions have been decoded by matching inaccordance with the invention, they may be used as preceding positionsP1, P1′ to form the basis of the prediction of a new position P2.

In step 920, the matching area MA (FIG. 2) of the position-codingpattern is generated around the predicted position. An example of agenerated matching area is given at 1000 in FIG. 10. For instance,aforesaid U.S. Pat. No. 6,667,695, in column 11, line 57-column 15, line14, and in FIG. 6 thereof, describes in detail how an area of theposition-coding pattern may be generated from a given position.

In step 930, one of the binary offset probability matrices, e.g. y-BOPM,is matched with the contents of the generated matching area in thecorresponding dimension, e.g. y dimension. To this end, matching unit740 will perform bitwise correlation between the y-BOPM and each equallysized partial area of the matching area. For each such bitwisecorrelation, the matching unit 740 will count the number ofcorresponding bits in the y-BOPM and the partial area. If a bit is setto the uncertainty value “-” in the y-BOPM, this position will simply bedispensed with and no bit correspondence will of course be credited thisposition.

Once the y-BOPM has been matched with the entire matching area, the CPU720 will determine the one of the partial areas for which the best matchoccurred with the y-BOPM (cf PA2 _(matched) in FIG. 2). In FIG. 10, thebest matching partial area of the matching area 1000 is indicated at1020.

In step 940, a resulting position (cf P2 _(matched) in FIG. 2) iscalculated from the best matching partial area. This position is easilydetermined, since the absolute start position of the matching area MA inthe position-coding pattern is already known (given by the predictedposition P2 _(predicted)). Thus, the resulting position is added as arelative position to the known absolute start position of the matchingarea MA so as to yield absolute-value coordinates of the predictedposition.

It is to be observed that this embodiment results in a fully decodedposition (both x and y coordinates) from the row pattern on y-BOPMmatching. Nevertheless, by also performing x-BOPM matching with thematching area in steps 950 and 960, the result of steps 930 and 940 maybe verified to gain robustness: if and only if the best correlationsagree on both coordinates, the result is accepted in step 970. Thus,steps 950 and 960 may implement the verifying step 360 of FIG. 3.

As an alternative to such a separate verifying operation in steps 950and 960, two match matrices, one for the y-BOPM matching and one for thex-BOPM matching, may be generated in parallel in steps 930 and 940. Amatrix element in each of these match matrices will represent the numberof matching x/y bit values for the partial area PA that starts with thatmatrix element's position in the matching area MA. By adding these twomatch matrices element by element, the CPU 720 may select the particularelement position having the highest resulting sum as the matchedposition P2 _(matched) sought for. Thus, in this case a verification isinherent in the matching operation.

Alternatively or additionally to the above verification methods, thepartial area(s) with the best correlation with the x-BPOM and/or they-BOPM may only be used for position determination if a matchingcriterion is met. The matching criterion may include that the number ofmatches (i.e. bit correspondences) exceeds a predetermined thresholdvalue and/or that the ratio of the number of matches to the number ofpossible matches exceeds a predetermined threshold value. The number ofpossible matches may be given by the number of “certain” values (i.e.not set to the uncertainty value “-”) in the x-BOPM and y-BOPM,respectively.

Pattern Sequence Matching

This method makes use of the fact that positions are coded in theposition-coding pattern based on two one-dimensional difference numbersequences. Thus, the matching may be handled as two one-dimensionalproblems rather than one two-dimensional. This will mean the searchingtime required for matching is linear (ordo (n+m)) instead of quadratic(ordo (n*m)), n and m being the side lengths of the matching area.

With reference to FIG. 13, the pattern sequence matching (PSM) method1300 starts with a step 1310 of predicting the next position P2_(predicted). Step 1310 may be performed in the same way as has beendescribed above for step 910 of FIG. 9.

In a step 1320, matching difference number subsequences MSx and MSy (see1220 in FIG. 12) are generated for a matching area MA (see 1200 in FIG.12) around the predicted position P2 _(predicted). The actual matchingarea itself is not generated, though, in contrast to the firstembodiment. Aforesaid U.S. Pat. No. 6,667,695 describes, in column 11,line 57-column 15, line 14, and in FIG. 6 thereof, how a differencenumber subsequence can be calculated from a given position.

A step 1330 derives sets of difference numbers Sx and Sy for therecorded partial area PA2, to be matched with the predicted matchingdifference number subsequences MSx and MSy produced in step 1320. First,with reference to FIG. 11, for each row/column 1110 in the y-BOPM/x-BOPMthe best matching main number subsequence 1120 in the main numbersequence 1100 is determined. This may be done by a fast matchingalgorithm, based on the fact that if six consecutive accurate bit values(i.e. having estimated values “0” or “1” but not “-”) are found in theBOPM, this combination of six values will inherently have a uniqueposition in the main number sequence. This unique main number sequenceposition may be obtained directly from a lookup table which isconveniently stored in memory 730 and consists of the 63 differentcyclic shifts of the main number sequence 1100. The other accuratepositions in the particular row/column 1110 of the y-BOPM/x-BOPM arethen checked against the particular main number sequence shift from thelookup table, and if also these are found to match, then the derivedmain number sequence position is held to be correct. If not, a fullbit-wise matching is done between the particular row/column 1110 of they-BOPM/x-BOPM and all 63 main number sequence shifts in the lookuptable, wherein the best match is selected as the derived main numbersequence position for that row/column 1110. Simultaneously, a mainnumber sequence match rate is registered in the form of the total numberof matching bit values for the particular row/column 1110 of they-BOPM/x-BOPM.

Then, step 1330 continues by deriving sets of difference numbers Sx andSy (1230 in FIG. 12) by subtracting derived main number sequencepositions for adjacent rows/columns. Also, each difference number isassigned a difference number match rate, for example by weighting (e.g.summing or averaging) the main number sequence match rates of therelated rows/columns, or by selecting the minimum thereof.

Now, in step 1340 the thus derived (i.e. observed) sets of differencenumbers Sx and Sy are matched with the predicted difference numbersubsequences MSx and MSy, as indicated at 1220 in FIG. 12. The bestmatch in the subsequences MSx and MSy may be selected as the respectiveconsecutive combination of difference numbers that yields the highestnumber of matches, optionally further distinguished by selecting thecombination thereof having the highest sum of difference number matchrates. Alternatively, the best match may be selected as the combinationof matching difference numbers that yields the highest sum of differencenumber match rates, irrespective of the number of matches.

In step 1350 the resulting position P2 _(matched) is determined from theresulting best match in step 1340. For reasons that are similar to theones given in the description above for step 940 of FIG. 9, thisresulting position is easily calculated.

In step 1360, the resulting position P2 _(matched) is verified, forinstance by generating a local verifying area of the position-codingpattern around position P2 _(matched) and correlating this bit-wise withthe x-BOPM and y-BOPM. This verification may include a matchingcriterion. As with the above-described Pattern Neighborhood Matching,the matching criterion may include that the number of matches (i.e. bitcorrespondences) should exceed a predetermined threshold value and/orthat the ratio of the number of matches to the number of possiblematches should exceed a predetermined threshold value. Instead ofgenerating a complete local verifying area around position P2_(matched), use may be made of the calculations performed in step 1330.Since the selected resulting position P2 _(matched) is the one with thebest match, many of the derived difference numbers are likely tocorrespond with the predicted ones. The numbers of matches for the bestmatching main number sequences underlying these corresponding differencenumbers are already known, via the above-mentioned main number sequencematch rate. Thus, a local verifying area need only be generated fordifference numbers which do not match.

Combination of Pattern Sequence Matching and Pattern NeighborhoodMatching

The two embodiments may be combined, for instance as will be describedwith reference to FIG. 14.

As seen at 1400, matching is performed based on the generated x-BOPM andy-BOPM and the matching area information obtained through the predictedposition. First, pattern sequence matching 1402 is performed. If thedecoding is successful, verification is performed at 1410. If, on theother hand, the pattern sequence matching 1402 fails, then patternneighborhood matching 1404 is performed. If this succeeds, verificationfollows at 1410. However, if also the pattern neighborhood matching 1404fails, an attempt to solve the position by other, known methods is madeat 1420. Such methods may involve any of the ones described in aforesaidU.S. Pat. No. 6,667,695, US 2003/0012455 and U.S. Pat. No. 6,674,427.There are situations where one could expect such methods to succeed evenif the matching methods according to the invention have failed. Oneexample is if the size of the matching area MA is too small to “catch upwith” a fast-writing user. Another example is when the pen is moved overa position discontinuity in the position-coding pattern, for instancewhen a pen stroke is drawn from one position-coded base to another. Ifthe position is successfully solved at 1420, the result is verified at1410.

If verification of a result from matching 1400 fails, a further attemptmay be made to solve the position at 1420. If also this attempt fails,another existing position-solving method may be tried at 1420, until allavailable ones have been tried.

The invention has mainly been described above with reference to a fewembodiments. However, as is readily appreciated by a person skilled inthe art, other embodiments than the ones disclosed above are equallypossible within the scope of the invention, as defined by the appendedpatent claims.

1. A method for position decoding, in which a sequence of positions isextracted from a sequence of images of a position-coding pattern, asrecorded by a sensor, said method comprising: retrieving at least onereference position; and extracting said sequence of positions solely bymatching information obtained from each of said images with acorresponding pattern reference area, which represents a known subset ofthe position-coding pattern with a given spatial relation to saidreference position.
 2. A method as in claim 1, wherein each position insaid sequence of positions is extracted by: determining a relativelocation, within said pattern reference area, of a match between saidinformation and said pattern reference area; and adjusting said spatialrelation by said relative location to thereby derive said position.
 3. Amethod as in claim 1, further comprising the step of generating saidpattern reference area for each image.
 4. A method as in claim 1,wherein said spatial relation is given by a predicted position, themethod comprising the step of estimating said predicted position basedon said at least one reference position.
 5. A method as in claim 4,wherein said pattern reference area is generated with a given positionalrelationship to said predicted position.
 6. A method as in claim 5,wherein said predicted position is included in the known subset of theposition-coding pattern.
 7. A method as in claim 4, wherein said step ofestimating is effected for each image, to generate a sequence ofpredicted positions.
 8. A method as in claim 7, wherein said sequence ofpredicted positions are converted, by said step of extracting bymatching, to said sequence of positions.
 9. A method as in claim 4,wherein each predicted position is estimated based on at least twopreceding positions selected from said at least one reference positionand/or said sequence of positions.
 10. A method as in claim 9, in whichsaid predicted position is estimated by polynomial extrapolation of saidat least two preceding positions.
 11. A method as in claim 1, in whicheach reference position is retrieved by calculating a position based onan image of said position-coding pattern in another way than said stepof extracting by matching.
 12. A method as in claim 11, wherein saidstep of calculating a position includes: extracting symbol data from anisolated image preceding said sequence of images; deriving position databy effecting one or more lookup operations, using said symbol data, inone or more data structures that contain fundamental coding data of theposition-coding pattern; and/or inputting said symbol or position datato a mathematical formula for explicit calculation of an absoluteposition.
 13. A method as in claim 1, further comprising the step ofmerging said at least one reference position with said sequence ofpositions.
 14. A method as in claim 1, wherein said step of retrievingis effected intermittently to update or replace said at least onereference position, the thus-retrieved reference position being used ina subsequent step of extracting by matching for a subsequent sequence ofimages.
 15. A method as in claim 1, wherein, for an individual imageamong said sequence of images, the corresponding pattern reference areaincludes a plurality of partial areas defining a plurality of respectivecandidates to a position represented by the position-coding pattern insaid individual image.
 16. A method as in claim 15, wherein said step ofextracting by matching includes comparing the information obtained fromsaid individual image with each of said plurality of partial areasincluded in the corresponding pattern reference area.
 17. A method as inclaim 16, wherein said step of extracting by matching includesselecting, for an individual image among said sequence of images, theone of said plurality of respective candidates for which the comparingstep indicates correspondence between the information obtained from saidindividual image and any of said plurality of partial areas.
 18. Amethod as in claim 1, wherein the position-coding pattern comprises aplurality of marks and wherein each mark codes one of at least twodifferent values in at least one dimension.
 19. A method as in claim 18,in which said step of extracting by matching includes obtaining saidinformation from an individual image among said sequence of images bygenerating a probability matrix, said probability matrix representing asubarea of the position-coding pattern which is included in saidindividual image and containing one matrix element for each mark in saidsubarea, wherein each matrix element is adapted to store either a valuewhich represents a most probable estimated value of its mark, or a valuewhich represents that no value has been estimated for its mark.
 20. Amethod as in claim 19, wherein said value which represents a mostprobable estimated value is an integer value.
 21. A method as in claim19, wherein each mark codes a binary value in a first dimension and abinary value in a second dimension, and wherein a first probabilitymatrix is generated for the values of the marks in said first dimensionand a second probability matrix is generated for the values of the marksin said second dimension.
 22. A method as in claim 19 and claim 16,wherein said step of extracting by matching includes comparing the oreach probability matrix with each of said plurality of partial areasincluded in the corresponding pattern reference area.
 23. A method as inclaim 19, each dimension of the position-coding pattern being based onshifts of a cyclic main number sequence, wherein any subsequence, of afirst predetermined length or longer, of said cyclic main numbersequence has an unambiguously determined position in said cyclic mainnumber sequence, and based on a sequence of difference numbersrepresenting differences in shifts between pairs of said main numbersequence in the position-coding pattern, wherein any subsequence, of asecond predetermined length or longer, of said sequence of differencenumbers has an unambiguously determined position in said sequence ofdifference numbers, said step of extracting by matching including:obtaining a first set of difference numbers for said pattern referencearea; obtaining a second set of difference numbers from the or eachprobability matrix; matching said second set of difference numbers withsaid first set of difference numbers; and extracting a position of saidposition-coding pattern, in said dimension, from a match from saidmatching step.
 24. A method as in claim 23, wherein said step ofobtaining a second set of difference numbers includes: matchingrespective rows or columns of the or each probability matrix with saidmain number sequence so as to estimate main number sequence positionsfor said rows or columns; and deriving the difference numbers of saidsecond set by subtracting estimated main number sequence positions forpairs of rows or columns of the or each probability matrix.
 25. A methodas in claim 1, wherein said sequence of positions represents at least apart of a handwriting stroke performed by way of an electronichandwriting tool.
 26. A method as in claim 4, said sequence of imagesbeing recorded by way of an electronic handwriting tool, wherein saidpredicted position is estimated based on said at least one referenceposition and at least one of the following: a predefined or detecteddirection of movement, speed or acceleration of said handwriting tool.27. A method for position decoding by determining a position on thebasis of information obtained from a partial area, recorded by a sensor,of a position-coding pattern, the position-coding pattern comprising aplurality of marks, each mark coding one of at least two differentvalues in at least one dimension, said method comprising: generating aprobability matrix, said probability matrix containing one matrixelement for each mark in said partial area, each matrix element beingadapted to store either a value which represents a most probableestimated value of its mark, or a value which represents that no valuehas been estimated for its mark; matching said probability matrix withinformation about how the position-coding pattern is composed in apattern reference area of said position-coding pattern, said patternreference area being larger than said partial area and including saidpartial area; and selecting, as the position to be determined, the oneof the positions defined by said pattern reference area for which thematching step indicates correspondence between said probability matrixand said pattern reference area.
 28. A method as in claim 27, whereinsaid value of a matrix element of said probability matrix whichrepresents a most probable estimated value is an integer value.
 29. Amethod as in claim 27, wherein each mark codes a binary value in a firstdimension and a binary value in a second dimension, and said probabilitymatrix is formed by a first probability matrix for the values of themarks in said first dimension and a second probability matrix for thevalues of the marks in said second dimension.
 30. A computer programwhich comprises program code which, when executed in a computer, causesthe computer to carry out a method according to claim
 1. 31. Acomputer-readable storage medium on which is stored a computer programwhich, when executed in a computer, causes the computer to carry out amethod according to claim
 1. 32. An apparatus for position decoding,comprising a signal-processing unit which is adapted to extract asequence of positions from a sequence of images of a position-codingpattern, as recorded by a sensor, wherein the signal-processing unit isfurther adapted to: retrieve at least one reference position; andextract said sequence of positions solely by matching informationobtained from each of said images with a corresponding pattern referencearea, which represents a known subset of the position-coding patternwith a given spatial relation to said reference position.
 33. Anapparatus for position decoding, comprising a signal-processing unitwhich is adapted to determine a position on the basis of informationobtained from a partial area, as recorded by a sensor, of aposition-coding pattern, the position-coding pattern comprising aplurality of marks, each mark coding one of at least two differentvalues in at least one dimension, wherein the signal-processing unit isfurther adapted to: generate a probability matrix, said probabilitymatrix containing one matrix element for each mark in said partial area,each matrix element being adapted to store either a value whichrepresents a most probable estimated value of its mark, or a value whichrepresents that no value has been estimated for its mark; match saidprobability matrix with information about how the position-codingpattern is composed in a pattern reference area of said position-codingpattern, said pattern reference area being larger than said partial areaand including said partial area; and select, as the position to bedetermined, the one of the positions defined by said pattern referencearea for which the matching step indicates correspondence between saidprobability matrix and said pattern reference area.
 34. A computerprogram which comprises program code which, when executed in a computer,causes the computer to carry out a method according to claim
 27. 35. Acomputer-readable storage medium on which is stored a computer programwhich, when executed in a computer, causes the computer to carry out amethod according to claim 27.